//
//  HOTCOLLECTIONCell.m
//  艾听歌
//
//  Created by dllo on 16/5/20.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HOTCOLLECTIONCell.h"

@implementation HOTCOLLECTIONCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.pic = [[UIImageView alloc] init];
//                self.pic.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.pic];
        
        self.namelabel = [[UILabel alloc] init];
//                self.namelabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:self.namelabel];
        
        self.songLabel = [[UILabel alloc] init];
//                self.songLabel.backgroundColor = [UIColor blackColor];
        [self.contentView addSubview:self.songLabel];
        
           }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    self.pic.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height - 50);
    self.songLabel.frame = CGRectMake(self.pic.frame.origin.x, 155, self.pic.frame.size.width, 20);
//    self.songLabel.textAlignment = YES;
    self.namelabel.frame = CGRectMake(self.pic.frame.origin.x, 180, self.pic.frame.size.width, 20);
    self.namelabel.font = [UIFont systemFontOfSize:14];
       
}
@end
